import { BrowserRouter, redirect, Route, Routes, useRoutes } from "react-router-dom";
// import Home from '../pages/home/Home.jsx'
// import Layout from '../pages/layout/Layout.jsx'
// import NotFound from "../pages/404/index.jsx";

import { lazy } from 'react'

const Layout = lazy(() => import('../pages/layout/Layout.jsx'))
const Home = lazy(() => import('../pages/home/Home.jsx'))
const NotFound = lazy(() => import('../pages/404/index.jsx'))


const routesList = [
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: '',
        element: <Home />
      },
      {
        path: 'home',
        element: <Home></Home>
      }
    ]
  },
  {
    path: '*',
    element: <NotFound />
  }
]

function WrapperRoutes() {
  let element = useRoutes(routesList)
  return element
}

export default WrapperRoutes;